package com.csoa.community.activity;

import java.util.ArrayList;
import java.util.List;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;

import com.collect.community.R;
import com.csoa.community.bean.LocalSpeciesBean;
import com.csoa.community.bean.WZInfoBean;
import com.csoa.community.db.LocalSpeciesInfoDB;
import com.csoa.community.db.WZInfoDB;
import com.csoa.community.singletons.GlobalVars;
import com.csoa.community.utils.StringUtils;
import com.csoa.community.widget.CommonDialogList;
import com.csoa.community.widget.CommonDialogList.OnListItemClickListener;

public class WZInfoActivity extends BaseProcessPhotoActivity {

	private EditText etChineseNameWZ;
	private EditText etLatinNameWZ;
	private TextView etcommonNameWZ;
	private EditText etcoverageWZ;// 盖度
	private EditText etheightWZ;
	private EditText etDBHWZ;// 胸径
	private EditText etquantityWZ;
	private EditText etsmallQuadratNumberWZ;
	private EditText etcharactersWZ;// 性状
	private EditText etfrequentnessWZ;// 频度
	private EditText etimportantLevelWZ;// 重要值
	private EditText etdistributionAreaWZ;// 分布区域
	private EditText etformationsWZ;// 所属群系

	private Spinner spinnerphenologyWZ;// 物候
	private Spinner spinnerviabilityWZ;// 生活力

	private Spinner spinnerlevelWZ;// 层次
	private Spinner spinnernicheWZ;// 生态位
	private Spinner spinnerdistributionTypeWZ;// 群系分布方式

	private CheckBox checkSZJHWZ;// 生境退化
	private CheckBox checkGDWJWZ;// 过度采掘
	private CheckBox checkZRZHJWZ;// 自然灾害
	private CheckBox checkWZYXWZ;// 本地物种影响
	private CheckBox checkHJWRWZ;// 环境污染
	private CheckBox checkRWFRWZ;// 其它人为干扰
	private CheckBox checkNZYSWZ;// 内在因素
	private CheckBox checkWLRQWZ;// 未来物种入侵影响
	private CheckBox checkOtherWZ;// 其它
	private WZInfoBean mWZInfo;
	private int mPosition;
	private int mYFId;

	protected List<String> names;
	private List<LocalSpeciesBean> species;
	private TextView mTVCurrentPage;
	private Animation mAnimationLeftIn;
	private Animation mAnimationRightIn;
	private View view;

	@Override
	public void initUI() {
		mWZInfo = (WZInfoBean) this.getIntent().getSerializableExtra("WZInfo");
		mPosition = this.getIntent().getIntExtra("position", 0);
		mWhich = this.getIntent().getIntExtra("which", 0);
		mYFId = this.getIntent().getIntExtra("yfId", 0);

		switch (mWhich) {
		case 0:// 查看
			setContentView(R.layout.wz_info_see);
			this.findViewById(R.id.layoutButton).setVisibility(View.VISIBLE);
			break;
		case 1:// 添加
			setContentView(R.layout.wz_info);
			this.findViewById(R.id.layoutButton).setVisibility(View.VISIBLE);
			this.findViewById(R.id.btnDelYF).setVisibility(View.GONE);
			break;
		case 3:// 修改
			setContentView(R.layout.wz_info);
			this.findViewById(R.id.layoutButton).setVisibility(View.VISIBLE);
			break;
		default:
			setContentView(R.layout.wz_info);
			this.findViewById(R.id.layoutButton).setVisibility(View.VISIBLE);
			this.findViewById(R.id.btnDelYF).setVisibility(View.GONE);
			break;
		}

		viewOnClick();

		layoutCameraYF = (LinearLayout) this.findViewById(R.id.layoutCameraYF);

		this.findViewById(R.id.btnCameraYF).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {

						Intent intent = new Intent(WZInfoActivity.this,
								CameraActivity.class);
						String imgName = getImgName(true);
						String imgPath = getImgPath(true);
						intent.putExtra("imgPath", imgPath);
						intent.putExtra("imgName", imgName);
						intent.putExtra("title", imgTitle);
						intent.putExtra("author", imgAuthor);
						startActivityForResult(intent, 1);

					}
				});

		layoutVedioYF = (LinearLayout) this.findViewById(R.id.layoutVedioYF);
		this.findViewById(R.id.btnVedioYF).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {

						String imgName = getImgName(false);
						String imgPath = getImgPath(false);
						Intent intent = new Intent(WZInfoActivity.this,
								VideoActivity.class);
						intent.putExtra("imgPath", imgPath);
						intent.putExtra("imgName", imgName);
						intent.putExtra("title", videoTitle);
						intent.putExtra("author", videoAuthor);
						startActivityForResult(intent, 2);
					}
				});
		etChineseNameWZ = (EditText) this.findViewById(R.id.etchineseNameWZ);
		etLatinNameWZ = (EditText) this.findViewById(R.id.etlatinNameWZ);
		etcommonNameWZ = (EditText) this.findViewById(R.id.etCommonNameWZ);
		etcoverageWZ = (EditText) this.findViewById(R.id.etcoverageWZ);
		etheightWZ = (EditText) this.findViewById(R.id.etheight);
		etDBHWZ = (EditText) this.findViewById(R.id.etDBHWZ);
		etquantityWZ = (EditText) this.findViewById(R.id.etquantityWZ);
		etsmallQuadratNumberWZ = (EditText) this
				.findViewById(R.id.etsmallQuadratNumberWZ);
		etcharactersWZ = (EditText) this.findViewById(R.id.etcharactersWZ);

		spinnerphenologyWZ = (Spinner) this
				.findViewById(R.id.spinnerphenologyWZ);
		
		initSpinner(spinnerphenologyWZ, GlobalVars.getInst().phenologys);
		spinnerviabilityWZ = (Spinner) this
				.findViewById(R.id.spinnerviabilityWZ);
		initSpinner(spinnerviabilityWZ, GlobalVars.getInst().viabilitys);
		etfrequentnessWZ = (EditText) this.findViewById(R.id.etfrequentnessWZ);
		etimportantLevelWZ = (EditText) this
				.findViewById(R.id.etimportantLevelWZ);

		spinnerdistributionTypeWZ = (Spinner) this
				.findViewById(R.id.spinnerdistributionTypeWZ);
		initSpinner(spinnerdistributionTypeWZ, GlobalVars.getInst().formations);
		spinnerlevelWZ = (Spinner) this.findViewById(R.id.spinnerlevelWZ);
		initSpinner(spinnerlevelWZ, GlobalVars.getInst().levels);

		spinnernicheWZ = (Spinner) this.findViewById(R.id.spinnernicheWZ);
		initSpinner(spinnernicheWZ, GlobalVars.getInst().niches);

		etformationsWZ = (EditText) this.findViewById(R.id.etformationsWZ);
		etdistributionAreaWZ = (EditText) this
				.findViewById(R.id.etdistributionAreaYF);
		

		checkSZJHWZ = (CheckBox) this.findViewById(R.id.checkSZJHWZ);
		checkGDWJWZ = (CheckBox) this.findViewById(R.id.checkGDWJWZ);
		checkZRZHJWZ = (CheckBox) this.findViewById(R.id.checkZRZHJWZ);
		checkWZYXWZ = (CheckBox) this.findViewById(R.id.checkWZYXWZ);
		checkHJWRWZ = (CheckBox) this.findViewById(R.id.checkHJWRWZ);
		checkRWFRWZ = (CheckBox) this.findViewById(R.id.checkRWFRWZ);
		checkNZYSWZ = (CheckBox) this.findViewById(R.id.checkNZYSWZ);
		checkWLRQWZ = (CheckBox) this.findViewById(R.id.checkWLRQWZ);
		checkOtherWZ = (CheckBox) this.findViewById(R.id.checkOtherWZ);
		fillData();
		if (mWhich == 0) {
			view = this.findViewById(R.id.scroller);
			view.setOnTouchListener(this);
			mAnimationLeftIn = AnimationUtils.loadAnimation(this,
					R.anim.slide_left_in);
			mAnimationRightIn = AnimationUtils.loadAnimation(this,
					R.anim.slide_right_in);
			modifyEditStyle();
			mTVCurrentPage = (TextView)this.findViewById(R.id.currentPage);
			updatePage();
		}

	}
	
	public void updatePage() {
		if(mTVCurrentPage != null) {
			mTVCurrentPage.setText((mPosition + 1) + "/" + WZInfoTableActivity.mWZInfos.size());
		}
		
	}
	
	public void fillData() {
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.imgPath)) {
			String[] strImgInfo = mWZInfo.imgPath.split(":");
			sbImgUrl = new StringBuffer("");
			sbImgName = new StringBuffer("");
			sbImgUrl.append(strImgInfo[0]);
			sbImgName.append(strImgInfo[1]);
			fillBitmapToLayout(sbImgUrl.toString(), sbImgName.toString(),
					layoutCameraYF, true);
		}else {
			layoutCameraYF.removeAllViews();
		}
		
		if (mWZInfo != null) {
			imgTitle = mWZInfo.imgTitle;
			imgAuthor = mWZInfo.imgAuthor;
			
			videoTitle = mWZInfo.videoTitle;
			videoAuthor = mWZInfo.videoAuthor;
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.videoPath)) {
			String[] strVideoInfo = mWZInfo.videoPath.split(":");
			sbVideoUrl = new StringBuffer("");
			sbVideoName = new StringBuffer("");
			sbVideoUrl.append(strVideoInfo[0]);
			sbVideoName.append(strVideoInfo[1]);
			fillBitmapToLayout(sbVideoUrl.toString(), sbVideoName.toString(),
					layoutVedioYF, false);
		}else {
			layoutVedioYF.removeAllViews();
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.chineseName)) {
			etChineseNameWZ.setText(mWZInfo.chineseName);
		}else {
			etChineseNameWZ.setText("");
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.latinName)) {
			etLatinNameWZ.setText(mWZInfo.latinName);
		}else {
			etLatinNameWZ.setText("");
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.commonName)) {
			etcommonNameWZ.setText(mWZInfo.commonName);
		}else {
			etcommonNameWZ.setText("");
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.coverage)) {
			etcoverageWZ.setText(mWZInfo.coverage);
		}else {
			etcoverageWZ.setText("");
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.height)) {
			etheightWZ.setText(mWZInfo.height);
		}else {
			etheightWZ.setText("");
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.DBH)) {
			etDBHWZ.setText(mWZInfo.DBH);
		}else {
			etDBHWZ.setText("");
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.quantity)) {
			etquantityWZ.setText(mWZInfo.quantity);
		}else {
			etquantityWZ.setText("");
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.smallQuadratNumber)) {
			etsmallQuadratNumberWZ.setText(mWZInfo.smallQuadratNumber);
		}else {
			etsmallQuadratNumberWZ.setText("");
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.characters)) {
			etcharactersWZ.setText(mWZInfo.characters);
		}else {
			etcharactersWZ.setText("");
		}
		if (mWZInfo != null) {
			spinnerphenologyWZ.setSelection(mWZInfo.phenologyPosition);
		}else {
			spinnerphenologyWZ.setSelection(0);
		}
		if (mWZInfo != null) {
			spinnerviabilityWZ.setSelection(mWZInfo.viabilityPosition);
		}else {
			spinnerviabilityWZ.setSelection(0);
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.frequentness)) {
			etfrequentnessWZ.setText(mWZInfo.frequentness);
		}else {
			etfrequentnessWZ.setText("");
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.importantLevel)) {
			etimportantLevelWZ.setText(mWZInfo.importantLevel);
		}else {
			etimportantLevelWZ.setText("");
		}
		if (mWZInfo != null) {
			spinnerdistributionTypeWZ
			.setSelection(mWZInfo.distributionTypePosition);
		}
		if (mWZInfo != null) {
			spinnerlevelWZ.setSelection(mWZInfo.levelPosition);
		}
		if (mWZInfo != null) {
			spinnernicheWZ.setSelection(mWZInfo.nichePosition);
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.formations)) {
			etformationsWZ.setText(mWZInfo.formations);
		}else {
			etformationsWZ.setText("");
		}
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.distributionArea)) {
			etdistributionAreaWZ.setText(mWZInfo.distributionArea);
		}else {
			etdistributionAreaWZ.setText("");
		}
		boolean[] isChecks = { false, false, false, false, false, false, false,
				false, false };
		if (mWZInfo != null && !StringUtils.isEmpty(mWZInfo.threatFactors)) {
			String[] types = mWZInfo.threatFactors.split(",");
			for (int i = 0; i < types.length; i++) {
				if ((types[i]).equals("1")) {
					isChecks[i] = true;
				} else {
					isChecks[i] = false;
				}
			}
			checkSZJHWZ.setChecked(isChecks[0]);
			checkGDWJWZ.setChecked(isChecks[1]);
			checkZRZHJWZ.setChecked(isChecks[2]);
			checkWZYXWZ.setChecked(isChecks[3]);
			checkHJWRWZ.setChecked(isChecks[4]);
			checkRWFRWZ.setChecked(isChecks[5]);
			checkNZYSWZ.setChecked(isChecks[6]);
			checkWLRQWZ.setChecked(isChecks[7]);
			checkOtherWZ.setChecked(isChecks[8]);
			
		}
	}
	
	@Override
	protected void ProcessPrePage() {
		prePage();
	}
	
	@Override
	protected void ProcessNextPage() {
		nextPage();
	}
	
	
	protected void prePage() {
		if (mPosition == 0) {
			showToast("没有更多物种名录了.");
			return;
		}
		view.startAnimation(mAnimationRightIn);
		mWZInfo = WZInfoTableActivity.mWZInfos
				.get(mPosition - 1);
		mPosition--;
		fillData();
		updatePage();
	}

	/**
	 * 上一页
	 */
	protected void nextPage() {
		if (mPosition == WZInfoTableActivity.mWZInfos
				.size() - 1) {
			showToast("没有更多物种名录了.");
			return;
		}
		view.startAnimation(mAnimationLeftIn);
		mWZInfo = WZInfoTableActivity.mWZInfos
				.get(mPosition + 1);
		mPosition++;
		fillData();
		updatePage();
	}
	

	public void viewOnClick() {
		this.findViewById(R.id.btnSaveYF).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						if (mWhich == 0) {
							prePage();
							return;
						}
						String latinName = etLatinNameWZ.getText().toString();
						if (StringUtils.isEmpty(latinName)) {
							showToast("您还没有填写拉丁名");
							return;
						}
						String chineseName = etChineseNameWZ.getText()
								.toString();
						if (StringUtils.isEmpty(chineseName)) {
							showToast("您还没有填写中文名");
							return;
						}

						String character = etcharactersWZ.getText().toString();
						if (StringUtils.isEmpty(character)) {
							showToast("您还没有填写性状信息");
							return;
						}
						String formation = etformationsWZ.getText().toString();
						if (StringUtils.isEmpty(formation)) {
							showToast("您还没有填写所属群系");
							return;
						}
						// String level = spinnerlevelWZ.getSelectedItem()
						// .toString();
						// String niche = spinnernicheWZ.getSelectedItem()
						// .toString();

						WZInfoBean wzInfo = createWZInfo();
						if (wzInfo != null) {
							Intent intent = new Intent();
							if (mWhich == 1) {
								WZInfoDB.insert(wzInfo);
							} else if (mWhich == 3) {
								WZInfoDB.updateById(wzInfo, mWZInfo.id);
								intent.putExtra("update", wzInfo);
								intent.putExtra("position", mPosition);
							} else {
								WZInfoDB.insert(wzInfo);
							}
							showToast("保存成功");
							setResult(RESULT_OK, intent);
							finish();
						}

					}
				});

		this.findViewById(R.id.btnDelYF).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						
						if (mWhich == 0) {
							nextPage();
							return;
						}
						
						new AlertDialog.Builder(WZInfoActivity.this)
								.setMessage("确认删除吗?")
								.setPositiveButton("确定", new OnClickListener() {

									@Override
									public void onClick(DialogInterface dialog,
											int which) {
										WZInfoDB.delete(mWZInfo);
										showToast("删除成功");
										Intent intent = new Intent();
										intent.putExtra("delete", mWZInfo);
										intent.putExtra("position", mPosition);
										setResult(RESULT_OK, intent);
										finish();
									}
								}).setNegativeButton("取消", null).show();

					}
				});

		this.findViewById(R.id.btnBackYF).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						setResult(RESULT_OK);
						finish();

					}
				});

		this.findViewById(R.id.btnQuaryChineseNameWZ).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						String chinese = etChineseNameWZ.getText().toString();
						showDialog(true, chinese);

					}
				});
		this.findViewById(R.id.btnQuaryLatinNameWZ).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						String latin = etLatinNameWZ.getText().toString();
						showDialog(false, latin);
					}
				});
	}

	public void showDialog(boolean isChenese, String queryContent) {
		names = new ArrayList<String>();
		if (isChenese) {
			species = LocalSpeciesInfoDB.query("", queryContent);
		} else {
			species = LocalSpeciesInfoDB.query(queryContent, "");
		}
		if (species != null) {
			for (int i = 0; i < species.size(); i++) {
				if (isChenese) {
					names.add(species.get(i).Chinese);
				} else {
					names.add(species.get(i).SName);
				}

			}

		}
		if (names != null && names.size() != 0) {
			CommonDialogList namesDialog = new CommonDialogList(_activity);
			namesDialog.setItems(names, new OnListItemClickListener() {

				@Override
				public void onListItemClick(int position) {
					etChineseNameWZ.setText(species.get(position).Chinese);
					etLatinNameWZ.setText(species.get(position).SName);
				}
			});
			namesDialog.show();

		} else {
			if (isChenese) {
				_activity.showToast("您搜索的中文名不存在");
			} else {
				_activity.showToast("您搜索的中文名不存在");
			}
		}
	}

	public WZInfoBean createWZInfo() {
		WZInfoBean wzInfo = new WZInfoBean();
		// wzInfo.groupId = "123456";
		wzInfo.yfId = mYFId;
		wzInfo.surveyMethod = "样方法";
		wzInfo.chineseName = etChineseNameWZ.getText().toString();
		wzInfo.latinName = etLatinNameWZ.getText().toString();
		wzInfo.commonName = etcommonNameWZ.getText().toString();
		wzInfo.characters = etcharactersWZ.getText().toString();
		wzInfo.quantity = etquantityWZ.getText().toString();
		wzInfo.coverage = etcoverageWZ.getText().toString();
		wzInfo.height = etheightWZ.getText().toString();
		wzInfo.frequentness = etfrequentnessWZ.getText().toString();
		wzInfo.DBH = etDBHWZ.getText().toString();
		wzInfo.phenology = spinnerphenologyWZ.getSelectedItem().toString();
		wzInfo.phenologyPosition = spinnerphenologyWZ.getSelectedItemPosition();

		wzInfo.viability = spinnerviabilityWZ.getSelectedItem().toString();
		wzInfo.viabilityPosition = spinnerphenologyWZ.getSelectedItemPosition();

		wzInfo.niche = spinnernicheWZ.getSelectedItem().toString();
		wzInfo.nichePosition = spinnernicheWZ.getSelectedItemPosition();

		wzInfo.threatFactors = (checkSZJHWZ.isChecked() ? "1" : "0") + ","
				+ (checkGDWJWZ.isChecked() ? "1" : "0") + ","
				+ (checkZRZHJWZ.isChecked() ? "1" : "0") + ","
				+ (checkWZYXWZ.isChecked() ? "1" : "0") + ","
				+ (checkHJWRWZ.isChecked() ? "1" : "0") + ","
				+ (checkRWFRWZ.isChecked() ? "1" : "0") + ","
				+ (checkNZYSWZ.isChecked() ? "1" : "0") + ","
				+ (checkWLRQWZ.isChecked() ? "1" : "0") + ","
				+ (checkOtherWZ.isChecked() ? "1" : "0");
		wzInfo.smallQuadratNumber = etsmallQuadratNumberWZ.getText().toString();
		wzInfo.importantLevel = etimportantLevelWZ.getText().toString();

		wzInfo.level = spinnerlevelWZ.getSelectedItem().toString();
		wzInfo.levelPosition = spinnerphenologyWZ.getSelectedItemPosition();
		wzInfo.formations = etformationsWZ.getText().toString();

		wzInfo.distributionType = spinnerdistributionTypeWZ.getSelectedItem()
				.toString();
		wzInfo.distributionTypePosition = spinnerdistributionTypeWZ
				.getSelectedItemPosition();

		wzInfo.distributionArea = etdistributionAreaWZ.getText().toString();

		String imgName = getImgName(true);
		String imgPath = getImgPath(true);
		

		if (imgPath != null && !"".equals(imgPath.toString())) {
			wzInfo.imgPath = imgPath + ":" + imgName;
		}
		wzInfo.imgTitle = imgTitle;
		wzInfo.imgAuthor = imgAuthor;

		String vedioName = getImgName(false);
		String vedioPath = getImgPath(false);
		if (vedioPath != null && !"".equals(vedioPath.toString())) {
			wzInfo.videoPath = vedioPath + ":" +  vedioName;
		}

		wzInfo.videoTitle = videoTitle;
		wzInfo.videoAuthor = videoAuthor;

		return wzInfo;
	}

	@Override
	public void initData() {

	}

	public void initSpinner(Spinner spinner, String[] data) {
		ArrayAdapter<String> areaAdapter = new ArrayAdapter<String>(this,
				R.layout.item_spinner, data);
		areaAdapter
				.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		spinner.setAdapter(areaAdapter);
	}

	/**
	 * 当页面为查看样式时,更改文本框显示样式
	 */
	public void modifyEditStyle() {
		etChineseNameWZ.setBackgroundResource(0);
		etLatinNameWZ.setBackgroundResource(0);
		etcommonNameWZ.setBackgroundResource(0);
		etcoverageWZ.setBackgroundResource(0);
		etheightWZ.setBackgroundResource(0);
		etDBHWZ.setBackgroundResource(0);
		etquantityWZ.setBackgroundResource(0);
		etsmallQuadratNumberWZ.setBackgroundResource(0);
		etcharactersWZ.setBackgroundResource(0);
		etfrequentnessWZ.setBackgroundResource(0);
		etimportantLevelWZ.setBackgroundResource(0);
		etdistributionAreaWZ.setBackgroundResource(0);
		etformationsWZ.setBackgroundResource(0);

		spinnerphenologyWZ.setBackgroundResource(0);
		spinnerviabilityWZ.setBackgroundResource(0);
		spinnerlevelWZ.setBackgroundResource(0);
		spinnernicheWZ.setBackgroundResource(0);
		spinnerdistributionTypeWZ.setBackgroundResource(0);

		this.findViewById(R.id.btnQuaryChineseNameWZ).setVisibility(View.GONE);
		this.findViewById(R.id.btnQuaryLatinNameWZ).setVisibility(View.GONE);

		this.findViewById(R.id.btnCameraYF).setVisibility(View.GONE);
		this.findViewById(R.id.btnVedioYF).setVisibility(View.GONE);

	}

}
